<!DOCTYPE html>
<html>
<html  xmlns:th="http://www.thymeleaf.org">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">

  <title>个人信息页面</title>

  <!-- 引入 jQuery Mobile 样式 -->
  <link rel="stylesheet" href="http://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.css">

  <!-- 引入 jQuery 库 -->
  <script src="http://apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>

  <!-- 引入 jQuery Mobile 库 -->
  <script src="http://apps.bdimg.com/libs/jquerymobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>

  <script src="/js/jquerymobile_popup.js"></script>




  <style type="text/css">
    body {
      font-family:微软雅黑,arial;
      font-size:16px;
      padding:0px;
      margin:0 auto;
    }

    .font-blue{
      color:#4E90C7!important;
    }

    .input-lightblue{
      background-color: #E5F2FD!important;
    }

    .font-label{
      color: black!important;
      font-size: 19px!important;
    }

    /* 验证错误提示信息*/
    form label.error{color: Red;padding:0px;margin:0px;line-height:0px;white-space: nowrap;}
  </style>
  <script type="text/javascript">
    function close(){
      WeixinJSBridge.call('closeWindow');
    }


    function updateUser() {
      // 常见的非空校验,长度校验,微信 表情输入的可能
      var dataObj = $("#formUser").serialize();// 表单所有的name:value


      $.ajax({
        url:'/user/updateUser',
        method: "post",
        data: dataObj,
        success: function (msg) {
          var cod = msg.code
          if (cod == '2000') {
            openPopup("个人信息更新成功", '提示', undefined, true, undefined, 'error', 'cn');
            // 可以将页面关闭,也可以显示该页面

          }else if (cod == "4001") {
            openPopup("个人信息参数输入不符合规范", '提示', undefined, true, undefined, 'error', 'cn');

          }
        }

      })
    }
  </script>
</head>
<body>
<div data-role="page" id="pageMain">
  <div data-role="header" data-theme="c" style="background-color: #4E90C7;" data-position="fixed">
    <a href="javascript:close()" >返回</a>
    <h1>个人信息</h1>
  </div>
  <div style="padding-top:20px;padding-bottom: 20px">

    <form id="formUser"   method="post">
      <!-- <div>基本信息</div> -->
      <input type="hidden" name="id" th:value="${user.id}">
      <div>
        <div style="padding-right:20px;padding-left:20px">
          <label for="name"  class="font-label">姓名(<font color="red">必填</font>)</label>
          <input type="text" name="name" id="name" th:value="${user.name}"  placeholder="请输入您的真实姓名" class="required font-blue input-lightblue">
        </div>

        <div class="ui-grid-a" style="padding-right:20px;padding-left:20px">
          <div class="ui-block-a" style="padding-right:10px">
            <label for="province"  class="font-label">省份</label>
            <input type="text" name="province" id="province" th:value="${user.province}"    class="font-blue input-lightblue">
          </div>
          <div class="ui-block-b" style="padding-left:10px">
            <label for="city"  class="font-label">城市</label>
            <input type="text" name="city" id="city" th:value="${user.city}"   placeholder="请输入您所在城市" class="font-blue input-lightblue">
          </div>
        </div>

        <div class="ui-grid-a" style="padding-right:20px;padding-left:20px">
          <div class="ui-block-a" style="padding-right:10px">
            <label for="zone"  class="font-label">区域</label>
            <input type="text"  id="zone" th:value="${user.zone}" placeholder="请输入您所在区域" readonly="readonly" class="font-blue input-lightblue">
          </div>
          <div class="ui-block-b" style="padding-left:10px">
            <label class="font-label">角色</label>
<!--            <span th:if="${user.rid==1}">-->
<!--              <input type="text" value="发单组" class="font-blue input-lightblue" readonly="readonly">-->
<!--            </span>-->
<!--            <span th:if="${user.rid==2}">-->
<!--              <input type="text" value="抢单组"  class="font-blue input-lightblue" readonly="readonly">-->
<!--            </span>-->

            <span th:if="${user.rid==1}">
              <input type="hidden" th:value="${user.rid}" name="rid" >
              <input type="text" th:value="发单组" class="font-blue input-lightblue" readonly="readonly">
            </span>
            <span th:if="${user.rid==2}">
              <input type="hidden" th:value="${user.rid}" name="rid" >
              <input type="text" th:value="抢单组" class="font-blue input-lightblue" readonly="readonly">
            </span>

          </div>
        </div>


        <div style="padding-right:20px;padding-left:20px">
          <label for="telephone"  class="font-label">手机号(<font color="red">必填</font>)</label>
          <input type="text" name="telephone" id="telephone" th:value="${user.telephone}"  placeholder="请输入您的手机号" class="required isPhone font-blue input-lightblue" >

          <label for="email"  class="font-label">邮箱(此项不可更改)</label>
          <input type="text" id="email" name="email" th:value="${user.email}" class="font-blue input-lightblue" readonly="readonly">
        </div>


      </div>

      <div style="padding-right:20px;padding-left:20px;padding-top:20px;">
        <input id="updateBtn" type="button" onclick="updateUser()" value="更新"  style="padding:10px;background: #e57330;text-shadow: none;opacity:100;color:white;font-size:20px;text-indent:0px;font-family:微软雅黑;" >
      </div>
    </form>
  </div>
</div>
</body>
</html>
